#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(this,&Widget::mysignal,this,&Widget::handlesignal);
    connect(this,&Widget::mysignal1,this,&Widget::handlesignal1);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::handlesignal1(const QString& text,const QString& text2)
{
    this->setWindowTitle(text);
    ui->pushButton_2->setText(text2);
}

void Widget::handlesignal(const QString &s1)
{
     this->setWindowTitle(s1);

}


void Widget::on_pushButton_clicked()
{
   // emit mysignal("good");
    emit mysignal1("adddd","dadad");
}

void Widget::on_pushButton_2_clicked()
{
    emit mysignal1("adddd","dadad");
}
